pkgname=pgbench
pkgver=15
pkgrel=0
arch=('i386' 'x86_64')
makedepends_debian_11=(tar gcc g++ zlib1g-dev libreadline-dev make)
source=("https://ftp.postgresql.org/pub/source/v15.0/postgresql-15.0.tar.gz")
md5sums=('SKIP')

build()
{
        if [ "$os" == "centos" ] || [ "$os" == "openeuler" ]; then
                mkdir -p "${pkgdir}/lkp/benchmarks/pgsql15"
                cd "$srcdir"
                cd postgresql-15.0/
                ./configure
                make
                make DESTDIR="${pkgdir}/lkp/benchmarks/pgsql15" install
        fi
}

package()
{
        if [ "$os" == "centos" ] || [ "$os" == "openeuler" ]; then
                benchmark_path="${pkgdir}/lkp/benchmarks/${pkgname}"
                mkdir -p "${benchmark_path}"
                cp -a "$srcdir/postgresql-15.0/" "$benchmark_path"
        fi
}
